package com.xhs.main.service.cwb.impl;

import com.xhs.main.dao.cwb.CwbMarketDao;
import com.xhs.main.entity.cwb.CwbMarket;
import com.xhs.main.service.cwb.CwbMarketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CwbMarketServiceImpl implements CwbMarketService {

    @Autowired
    CwbMarketDao cwbMarketDao;


    @Override
    public void addCwbMarket(CwbMarket cwbMarket) {
        cwbMarketDao.insertCwbMarket(cwbMarket);
    }

    @Override
    public List<CwbMarket> getAllCwbMarket() {
        List<CwbMarket> cwbMarkets =  cwbMarketDao.selectAllCwbMarket();
        return cwbMarkets;
    }

    @Override
    public CwbMarket getOneByID(Integer cwbMId) {
        CwbMarket cwbMarket = cwbMarketDao.selectOneByID(cwbMId);
        return cwbMarket;
    }

    @Override
    public Double getAllMoney() {
        Double money = cwbMarketDao.selectAllMoney();
        return money;
    }

    @Override
    public Double getjidumoney(String beginDate, String endDate) {
        Double money = cwbMarketDao.selectjidumoney(beginDate, endDate);
        return money;
    }

    @Override
    public Double getmoney(String date) {
        Double money = cwbMarketDao.selectmoney(date);
        return money;
    }

    @Override
    public Integer getAllOpr() {
        Integer conut = cwbMarketDao.selectAllOpr();
        return conut;
    }

    @Override
    public Integer getAllNoOpr() {
        Integer conut = cwbMarketDao.selectAllNoOpr();
        return conut;
    }


}
